# -*- coding: utf-8 -*-

# pip install gevent
import gevent


def one():
    print("def one")
    print(gevent.getcurrent())
    gevent.sleep(1)
    print("one end")
    pass


def two():
    print("def two")
    print(gevent.getcurrent())
    gevent.sleep(3)
    print("two end")
    pass


def ten():
    print("def ten")
    print(gevent.getcurrent())
    gevent.sleep(2)
    print("ten end")
    pass


if __name__ == '__main__':
    print("main")
    gevent.joinall(greenlets=[
        gevent.spawn(two),
        gevent.spawn(one),
        gevent.spawn(ten),

    ])
    print("pass")

    pass
